package com.googlecode.jmicroerp.model;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author alex
 */
@Entity
@Table(name = "stocuri")
public class Stoc extends AbstractEntitate {

    private Produs produs;
    private Recipient recipient;
    private BigDecimal cantitate;
    private Boolean monitorizeaza;

    @ManyToOne(fetch = FetchType.LAZY, targetEntity = Produs.class)
    @JoinColumn(name = "PRODUS_ID")
    public Produs getProdus() {
        return produs;
    }

    public void setProdus(Produs produs) {
        this.produs = produs;
    }

    @Column(name = "cantitate")
    public BigDecimal getCantitate() {
        return cantitate;
    }

    public void setCantitate(BigDecimal cantitate) {
        this.cantitate = cantitate;
    }

    @OneToOne(fetch = FetchType.LAZY, targetEntity = Recipient.class)
    @JoinColumn(name = "RECIPIENT_ID")
    public Recipient getRecipient() {
        return recipient;
    }

    public void setRecipient(Recipient recipient) {
        this.recipient = recipient;
    }


    @Column(name = "MONITORIZEAZA")
    public Boolean getMonitorizeaza() {
        return monitorizeaza;
    }

    public void setMonitorizeaza(Boolean monitorizeaza) {
        this.monitorizeaza = monitorizeaza;
    }
}
